package population.populationFindPredicates;

import character.Character;
import character.Gender;

/**
 * Find all characters of specific gender.
 * @author pcdejager
 *
 */
public class FindGender implements PopulationFindPredicate {
    /**
     * Constructor.
     * @param g The gender to find
     */
    public FindGender(final Gender g) {
        gender = g;
    }

    /**
     * The check method.
     * @param c The character to check
     * @return True if correct gender, else false
     */
    public final boolean check(final Character c) {
        if (c.getGender() == gender) {
            return true;
        }
        return false;
    }

    /**
     * The gender to find.
     */
    private Gender gender;
}
